<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>查询第一个出现一次的字母</title>
	<link rel="stylesheet" href="">
</head>
<body>
	<script>
		

		function get(str) {
			let obj = {}
			for(i = 0; i < str.length; i++) {
				let item = str.charAt(i)
				if(obj[item]) {
					obj[item]++
				}else{
					obj[item] = 1
				}
			}
			for(key in obj) {
				if(obj[key] == 1) {
					return key
				}
			}
		}
		let str = 'aasgdg'
		let str1 = 'djsdklghalg'
		get(str)
	</script>
</body>
</html>